{if isset($collection)} {assign var="routes"
value=$collection->getAllRoutes()}

<h2>{$collection->getName()}</h2>


<form action="" method="post">
  <p>Endre starttidspunkt</p>
  <div class="color">
    
<table>

	<tr>
<td rowspan="2" id="Label">Dag:</td>
		{section name="foo" loop=7}
		<td class="day">{$date->format('D')}</td>
		{$date->modify('+1 day')} {/section}
	</tr>
	<tr>
		{$date->modify('-7 day')} {section name="cal" loop=7}
		<td><input type="radio" name="date" value="{$date->format('Y-m-d')}"
			{if $ch_day==$date->format('Y-m-d')}checked="checked"{assign
		var="day" value=$smarty.section.cal.index}{/if}/></td>
		{$date->modify('+1 day')} {/section}
	</tr>
</table>
</div>
<div class="color">
<label for="besk" class="space">Klokkeslett:</label> <select name="time">
	{section name="hour" loop="24"} {assign var="time"
	value=$smarty.section.hour.index}
	<option value="{$time}" {if $ch_time==$time} selected="selected"{/if}>{if
	$time<10}0{/if}{$time}:00</option>
	{/section}
</select> 
</div>
<div class="color">
<input type="submit" value="Hent vær" />
</div>
</form>





{foreach from=$routes item="route" name="routeItr"}

<div class="forecast-day">
<h2 id="route">{$route->getName()}</h2>
<p>
{if $route->getRouteType() == "Rv"}
<span id="roadinfoboxr">
{else}
<span id="roadinfoboxe">
{/if}
{if $route->getRouteType() == "Ev"}
E{$route->getRouteNumber()}
{else}
{$route->getRouteType()}{$route->getRouteNumber()}
{/if}
</span>

<a href='http://www.vegvesen.no/cs/Satellite?c=Page&cid=1192092504422&pagename=vegmeldinger%2FPage%2FVMside&roadtype={$route->getRouteType()}&roadnumber={$route->getRouteNumber()}'>Link til vegmelding</a>

</p>
{foreach from=$route->getPlaceArray() item="place" name="placeItr"} 

{assign var='passby' value=$place->getHour()} 
{assign var='weather' value=$place->getForecast($day,$ch_time,true)}

<div class="forecast-box">
<h3>{$place->getName()}</h3>
<h3>{$place->getNiceDate()} kl {$place->getNiceHour()}.00</h3>
<table summary="">
	<tbody>
		<tr>
			<td class="w-icon" title="">{foreach from=$weather->getWeatherSymbols() item="symbol"} 
			<img src={$place->getSymbolString($symbol) alt='vær {$symbol}' /> {assign var='weatherSum1'
			value=$weatherSum1+$symbol} {/foreach}</td>

			{if $weather->getTemperature()>0}
			<td class="plus">{$weather->getTemperatureRound()}&deg;</td>
			{/if} {if $weather->getTemperature()<=0}
			<td class="plus">{$weather->getTemperatureRound()}&deg;</td>
			{/if}



			<td class="wind" title="Flau vind, 0,8 m/s fra søraust"><img
				src='http://www.yr.no/grafikk/pil.aspx?r={$weather->getWindDir()}&h={$weather->getWindSpeed()}' />
			</td>
			<td></td>
		</tr>
	</tbody>
</table>



<p>{$weather->getWindSpeedTxt()}, fra {$weather->getWindDirTxt()}.
{$weather->getPrecipitation()} mm nedbør.</p>


</div>



{/foreach}</div>
{/foreach} {else}
<div id="predefvalg">
	<p>Vennligst velg rute nedenfor</p>
	<table>
	<tr>
		<td><a href="?page=predef&amp;id=1">Oslo - Bergen</a></td>
		<td><a href="?page=predef&amp;id=5">Oslo - Trondheim</a></td>
		<td><a href="?page=predef&amp;id=3">Bergen - Stavanger</a></td>
		<td><a href="?page=predef&amp;id=7">Oslo - Stavanger</a></td>
	</tr>
	<tr>
		<td><a href="?page=predef&amp;id=2">Bergen - Oslo</a></td>
		<td><a href="?page=predef&amp;id=6">Trondheim - Oslo</a></td>
		<td><a href="?page=predef&amp;id=4">Stavanger - Bergen</a></td>
		<td><a href="?page=predef&amp;id=8">Stavanger - Oslo</a></td>
	</td>
</table>
</div>
<div class="clear"></div>
{/if}
